<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<script type="text/javascript">
		//
		function createTea(name) {
			//相当于做馒头的白面  创建一个空白对象---原材料
			let obj = {}

			//添加属性和方法 ---- 加工
			obj.name = name
			obj.getName = function() {
				console.log(this.name + "做王哥庄大馒头")
			}

			//出厂
			return obj
		}

		let obj1 = createTea("孙悟空")
		obj1.getName()

		let obj2 = createTea("猪八戒")
		obj2.getName()
	</script>
</body>
</html>